// 构造+原型还是使用ES6类来写
function MyPromise(fn) {
  console.log(fn)
  // Promise只有2各种状态 一种是 pending 还是一种终止状态 resolved rejected失败
  let promiseStatus = 'pending'
  let RESOLVED = 'resolved'
  let REJECTED = 'rejected'
  // 实现核心啊部分
  // 定义resolve函数作为实参
  let resolveFn = () => {

  }
  let rejectFn = () => {
    
  }
  fn(resolveFn, rejectFn)
}

var p = new MyPromise(function (resolve, reject) {
  // resolve reject是形参 
  // 这里使用定时器模拟一些异步操作比如ajax请求等...
  console.log(6666) // 会立即执行
  setTimeout(() => {
    // resolve()
  }, 0)
})
